package com.hns.can.master.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.hns.can.common.entity.BaseEntity;
import com.hns.tool.pub.PubUtil;

/**
 * 驾驶心情指数信息实体
 * @author:Fisher
 * @email:zhuangcaijin@126.com
 * @version Revision 2.0.0
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "T_COMM_DRIVE_MD_IDNX_INFO")
public class CommDriveMdIdnxInfoEntity extends BaseEntity {
    
    @Id
    @Column(name = "RCRD_ID")
    private String     rcrdId;
    @Column(name = "CORP_ID")
    private String     corpId;
    @Column(name = "ORGAN_ID")
    private String     organId;
    @Column(name = "LINE_ID")
    private String     lineId;
    @Column(name = "CAR_ID")
    private String     carId;
    @Column(name = "DRV_ID")
    private String     drvId;
    @Column(name = "RCRD_TIME")
    private String     rcrdTime;
    @Column(name = "RCRD_JRNL_NO")
    private String     rcrdJrnlNo;
    @Column(name = "EQMT_CODE")
    private String     eqmtCode;
    @Column(name = "LIC_PLT_NO")
    private String     licPltNo;
    @Column(name = "LINE_CODE")
    private String     lineCode;
    
    @Column(name = "UP_DN")
    private String     upDn;
    @Column(name = "PRVS_STN_NO")
    private String     prvsStnNo;
    @Column(name = "NEXT_STN_NO")
    private String     nextStnNo;
    
    @Column(name = "DRV_MOOD_TYPE")
    private String     drvMoodType;
    @Column(name = "LO_LGT")
    private BigDecimal     loLgt;
    @Column(name = "LO_LTT")
    private BigDecimal     loLtt;
    @Column(name = "GEN_TIME")
    private Date  genTime;
    @Column(name = "LO_DRC")
    private BigDecimal loDrc;
    @Column(name = "APPROVE_ID")
    private String     approveId;
    @Column(name = "APPROVE_STATE")
    private String     approveState;
    @Column(name = "REMARK")
    private String     remark;
    
    @Transient
    private String gpsDetailAdr;//GPS_DETAIL_ADR
    @Transient
    private String drvName;
    @Transient
    private String lineName;
    @Transient
    private String organName;
    @Transient
    private String moodStatus;
    @Transient
    private String approveUser;
    @Transient
    private String subtime;
    @Transient
    private BigDecimal counttype;
    @Transient
    private BigDecimal score;
    @Transient
    private BigDecimal allrank;
    
    // -------------------------------
    public static final String TABLENAME = "T_COMM_DRIVE_MD_IDNX_INFO";
    
    // -------------------------------------
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        
        CommDriveMdIdnxInfoEntity other = (CommDriveMdIdnxInfoEntity) obj;
        
        if ((PubUtil.isEmpty(this.corpId) && PubUtil.isNotEmpty(other.corpId)) || !this.corpId.equals(other.corpId)) {
            return false;
        }
        
        if ((PubUtil.isEmpty(this.eqmtCode) && PubUtil.isNotEmpty(other.eqmtCode)) || !this.eqmtCode.equals(other.eqmtCode)) {
            return false;
        }
        
        if ((PubUtil.isEmpty(this.rcrdTime) && PubUtil.isNotEmpty(other.rcrdTime)) || !this.rcrdTime.equals(other.rcrdTime)) {
            return false;
        }
        
        return true;
    }
    
    public String getRcrdId() {
        return this.rcrdId;
    }
    
    public void setRcrdId(String rcrdId) {
        this.rcrdId = rcrdId;
    }
    
    
    public String getCorpId() {
        return this.corpId;
    }
    
    public void setCorpId(String corpId) {
        this.corpId = corpId;
    }
    
    
    public String getOrganId() {
        return this.organId;
    }
    
    public void setOrganId(String organId) {
        this.organId = organId;
    }
    
    
    public String getLineId() {
        return this.lineId;
    }
    
    public void setLineId(String lineId) {
        this.lineId = lineId;
    }
    
    
    public String getCarId() {
        return this.carId;
    }
    
    public void setCarId(String carId) {
        this.carId = carId;
    }
    
    
    public String getDrvId() {
        return this.drvId;
    }
    
    public void setDrvId(String drvId) {
        this.drvId = drvId;
    }
    
    
    public String getRcrdTime() {
        return this.rcrdTime;
    }
    
    public void setRcrdTime(String rcrdTime) {
        this.rcrdTime = rcrdTime;
    }
    
    
    public String getRcrdJrnlNo() {
        return this.rcrdJrnlNo;
    }
    
    public void setRcrdJrnlNo(String rcrdJrnlNo) {
        this.rcrdJrnlNo = rcrdJrnlNo;
    }
    
    
    public String getEqmtCode() {
        return this.eqmtCode;
    }
    
    public void setEqmtCode(String eqmtCode) {
        this.eqmtCode = eqmtCode;
    }
    
    
    public String getLicPltNo() {
        return this.licPltNo;
    }
    
    public void setLicPltNo(String licPltNo) {
        this.licPltNo = licPltNo;
    }
    
    
    public String getLineCode() {
        return this.lineCode;
    }
    
    public void setLineCode(String lineCode) {
        this.lineCode = lineCode;
    }
    
    
    public String getDrvMoodType() {
        return this.drvMoodType;
    }
    
    public void setDrvMoodType(String drvMoodType) {
        this.drvMoodType = drvMoodType;
    }
    
    public BigDecimal getLoLgt() {
        return loLgt;
    }

    public void setLoLgt(BigDecimal loLgt) {
        this.loLgt = loLgt;
    }

    public BigDecimal getLoLtt() {
        return loLtt;
    }

    public void setLoLtt(BigDecimal loLtt) {
        this.loLtt = loLtt;
    }

    public Date getGenTime() {
        return this.genTime;
    }
    
    public void setGenTime(Date genTime) {
        this.genTime = genTime;
    }
    
    
    public BigDecimal getLoDrc() {
        return this.loDrc;
    }
    
    public void setLoDrc(BigDecimal loDrc) {
        this.loDrc = loDrc;
    }

    public String getApproveId() {
        return approveId;
    }

    public void setApproveId(String approveId) {
        this.approveId = approveId;
    }

    public String getApproveState() {
        return approveState;
    }

    public void setApproveState(String approveState) {
        this.approveState = approveState;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getGpsDetailAdr() {
        return gpsDetailAdr;
    }

    public void setGpsDetailAdr(String gpsDetailAdr) {
        this.gpsDetailAdr = gpsDetailAdr;
    }

    public String getDrvName() {
        return drvName;
    }

    public void setDrvName(String drvName) {
        this.drvName = drvName;
    }

    public String getLineName() {
        return lineName;
    }

    public void setLineName(String lineName) {
        this.lineName = lineName;
    }

    public String getOrganName() {
        return organName;
    }

    public void setOrganName(String organName) {
        this.organName = organName;
    }

    public String getMoodStatus() {
        return moodStatus;
    }

    public void setMoodStatus(String moodStatus) {
        this.moodStatus = moodStatus;
    }

    public String getApproveUser() {
        return approveUser;
    }

    public void setApproveUser(String approveUser) {
        this.approveUser = approveUser;
    }
    
    public String getMoodMsg(){
        if(PubUtil.isNotEmpty(getDrvMoodType()) && getDrvMoodType().equals("0")){
            return "心情急躁";
        }else if(PubUtil.isNotEmpty(getDrvMoodType()) && getDrvMoodType().equals("1")){
            return "超车未果";
        }else{
            return "未知";
        }
    }
    
    public String getApproveMsg(){
        if(PubUtil.isNotEmpty(getApproveState()) && getApproveState().equals("1")){
            return "已审核";
        }else if(PubUtil.isNotEmpty(getApproveState()) && getApproveState().equals("0")){
            return "未审核";
        }else{
            return "未知";
        }
    }

    public String getSubtime() {
        return subtime;
    }

    public void setSubtime(String subtime) {
        this.subtime = subtime;
    }

    public BigDecimal getCounttype() {
        return counttype;
    }

    public void setCounttype(BigDecimal counttype) {
        this.counttype = counttype;
    }

    public BigDecimal getScore() {
        return score;
    }

    public void setScore(BigDecimal score) {
        this.score = score;
    }

    public BigDecimal getAllrank() {
        return allrank;
    }

    public void setAllrank(BigDecimal allrank) {
        this.allrank = allrank;
    }

    public String getUpDn() {
        return upDn;
    }

    public void setUpDn(String upDn) {
        this.upDn = upDn;
    }

    public String getPrvsStnNo() {
        return prvsStnNo;
    }

    public void setPrvsStnNo(String prvsStnNo) {
        this.prvsStnNo = prvsStnNo;
    }

    public String getNextStnNo() {
        return nextStnNo;
    }

    public void setNextStnNo(String nextStnNo) {
        this.nextStnNo = nextStnNo;
    }

    public String getStationAdr() {
//        if(PubUtil.isEmpty(this.getPrvsStnNo()) || PubUtil.isEmpty(this.getNextStnNo())){
//            return "-";
//        }else{
//            return this.getPrvsStnNo()+"-"+this.getNextStnNo();
//        }
    	return this.getPrvsStnNo();
    }
    
}
